#define _CRT_SECURE_NO_WARNINGS 1
int IsNarc(int x)
{
	int i, t=0,m,sum=0;
	m = x;
	while (m > 0)
	{
		t++;
		int n = m % 10;
		sum = sum + n * n * n;
		m = m / 10;
	}
	if (sum == x && t == 3) return 1;
	else return 0;
}
void TimeOutput2(int hour, int minute, double second)
{
	if (hour < 12 && hour >= 0)
	{
		if (second >= 0 && second < 10) printf("%02d:%02d:0%.2lf(AM)", hour, minute, second);
		else printf("%02d:%02d:%.2lf(AM)", hour, minute, second);
	}
	else if (hour >= 12 && hour < 24)
	{
		if (hour == 12) hour = hour + 12;
		if (second >= 0 && second < 10) printf("%02d:%02d:0%.2lf(PM)", hour - 12, minute, second);
		else printf("%02d:%02d:%.2lf(PM)", hour - 12, minute, second);
	}
}
void FindAutomorphic(int lower, int upper)
{
    int i, m, num, f, k, n, p = 0;
    for (i = lower; i <= upper; i++)
    {
        if (i == 0 || i == 1) printf("%d\n", i), p = 1;
        else
        {
            m = i * i;
            n = i;
            f = 1;
            while (n > 0)
            {
                if (n % 10 != m % 10)
                {
                    f = 0;
                    break;
                }
                n = n / 10;
                m = m / 10;
            }
            if (f == 1) printf("%d\n", i), p = 1;
        }
    }
    if (p == 0) printf("None");
}
